﻿Public Partial Class OpenPicnik
    Inherits System.Web.UI.Page

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        Dim apikey As String = System.Configuration.ConfigurationManager.AppSettings("PicnikKey")
        Dim url = Request.Params("url")
        If String.IsNullOrEmpty(url) OrElse String.IsNullOrEmpty(apikey) Then
            Response.Write("You must set PicnikKey in web.config for this functionality.")
            Exit Sub
        End If

        url = "http://www.picnik.com/service/?_apikey=" & apikey & _
           "&_import=" & HttpUtility.UrlEncode(url)

        Response.AppendHeader("Refresh", "0; url=" & url)
        Response.Write("Loading <a href=""" & url & ">Picnik</a>....")

    End Sub

End Class